Home > biomechZoo > Toolbox > Support Functions > setWindowOnTop.m

setWindowOnTop

PURPOSE ^

SETWINDOWONTOP sets a figures Always On Top state on or off

SYNOPSIS ^

function setWindowOnTop(h,state)

DESCRIPTION ^

 SETWINDOWONTOP sets a figures Always On Top state on or off

  Copyright (C) 2006  Matt Whitaker
 
  This program is free software; you can redistribute it and/or modify it
  under
   the terms of the GNU General Public License as published by the Free
   Software Foundation; either version 2 of the License, or (at your
   option) any later version.
 
  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.

 SETWINDOWONTOP(H,STATE): H is figure handle or a vector of figure handles
                          STATE is a string or cell array of strings-
                               'true' - set figure to be always on top
                               'false' - set figure to normal
                           if STATE is a string the state is applied to
                           all H. If state is a cell array the length STATE
                           must equal that of H and each state is applied
                           individually.
  Examples: 
   h= figure;
   s = 'true';
   setWindowOnTop(h,s) %sets h to be on top
   
   h(1) = figure;
   h(2) = figure; 
   s = 'true';
   setWindowOnTop(h,s) %sets both figures to  be on top

   h(1) = figure;
   h(2) = figure; 
   s = {'true','false'};
   setWindowOnTop(h,s) %sets h(1) on top, h(2) normal
 Notes: 
 1. Figures must have 'Visible' set to 'on' and not be docked for
    setWindowOnTop to work.
 2. Routine does not work for releases prior to R14SP2
 3. The Java calls are undocumented by Mathworks

 Revisions: 09/28/06- Corrected call to warning and uopdated for R2006b

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sun 10-Mar-2024 22:39:06 by m2html © 2005